<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <script type="text/javascript" src="js/vue.js"></script>
</head>
<body>

    <div id="root">

        ￥: <input type="number" v-model="cm"><br><br>
         $ : <input type="text" v-model="am" readonly="readonly">

         <p>{{text}}</p>
        
    </div>
    
</body>

<script>
    vm = new Vue({
        el: '#root',
        data:{
            cm:100,
            am:14.705882352941178,
            text: '100人民币=14.71美元'
        },
        watch:{
            cm(newvalue){
                this.am = 0.14705882352941178 * newvalue
                this.text = this.cm + '人民币=' + this.am.toFixed(2) + '美元'
            }
        }
    })
</script>

</html>